package com.xxkj.redis;

import com.xxkj.redis.config.KlockConfig;
import com.xxkj.redis.core.BusinessKeyProvider;
import com.xxkj.redis.core.KlockAspectHandler;
import com.xxkj.redis.core.LockInfoProvider;
import com.xxkj.redis.lock.LockFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import({KlockAspectHandler.class})
public class KlockConfiguration {
    @Bean
    public LockInfoProvider lockInfoProvider(){
        return new LockInfoProvider();
    }

    @Bean
    public BusinessKeyProvider businessKeyProvider(){
        return new BusinessKeyProvider();
    }

    @Bean
    public LockFactory lockFactory(){
        return new LockFactory();
    }
    @Bean
    public KlockConfig klockConfig(){
        return new KlockConfig();
    }
}
